﻿namespace EFS.RC.CC.CH.Tables
{
	public static class EventLogs
	{
		/// Create
		public static System.Int32? Create(
			System.DateTime occurred,
			System.Guid conversationGuid,
			System.Int32? endpoint_id,
			System.String customer_uri,
			System.Guid? agentADGuid,
			System.Guid? supervisorADGuid,
			System.Int64? hwPartyID,
			System.Int32? hwApplicantID,
			System.Int32? conversationClassID,
			EFS.RC.CC.Events.Conversation eventCode,
			EFS.DB.Connection connection)
		{
			// check
			EFS.Common.Verify.Reference(connection, "connection");

			// make params
			EFS.DB.Parameters.Array parametersArray = new EFS.DB.Parameters.Array(
				new System.String[] { "occurred", "conversation_guid", "endpoint_id", "customer_uri", "agent_ad_guid", "supervisor_ad_guid", "hw_party_id", "hw_applicant_id", "conversation_class_id", "event_code", "id" },
				new System.Object[] { occurred, conversationGuid, endpoint_id, customer_uri, agentADGuid, supervisorADGuid, hwPartyID, hwApplicantID, conversationClassID, eventCode, default(System.Int32) },
				new System.Boolean[] { false, false, false, false, false, false, false, false, false, false, true });
			
			// create
			connection.DoExecuteNonQuery("[dbo].[EventLogs_Create]", parametersArray);

			// get id value
			return parametersArray.GetOutPrameterValue<System.Int32?>("id"); 
		}

		
	}

}